import request from '@/utils/request'
import { qualityApiUrl } from '@/api/config.js'

// 风险识别与监控记录 //
/**
 * 查询风险管控记录列表-所有的项目所有的记录列表
 * @param data
 */
export function getList(data) {
  return request({
    url: qualityApiUrl + '/quality/riskMonitorRecord/queryDetails',
    method: 'post',
    data: data
  })
}
/**
 * 查询单个风险跟踪
 * @param id
 */ 
export function getDetail(id) {
  return request({
    url: qualityApiUrl + `/quality/riskMonitorRecord/findChecks/${id}`,
    method: 'get',
  })
}

/**
 * 验证一条计划项
 * @param data
 */
export function verificate(data) {
    return request({
      url: qualityApiUrl + '/quality/riskMonitorRecord/verificate',
      method: 'post',
      data: data
    })
  }
/**
 打印
  */
export function primaryPrint(params) {
  return request({
    url: qualityApiUrl + '/quality/print',
    method: 'get',
    params
  })
}
/**
 导出风险信息
  */
 export function impRecords(data) {
  return request({
      url: qualityApiUrl + '/quality/riskMonitorRecord/impRecords',
      method: 'post',
      data
  })
}

export const monitoringRecords = {
    getList,
    getDetail,
    verificate,
    primaryPrint,
    impRecords
  }